Regular Expressions
Regular expressions are a way of defining patterns in information by using special symbols. These expressions can be used to identify, constrain, display, or extract information.
Using regular expressions with Laserfiche applications
Laserfiche applications make use of regular expressions in various ways, depending on the aims of the application. See some common regular expressions examples.
Forms
Regular expressions can restrict the format of values entered in a field. For example, a regular expression can require that a user adds dashes to a phone number or Social Security number, but it cannot automatically add those dashes. To automatically change the appearance of entered values, you'll want to use field masks. Field masks change how values are displayed on a form, and are accomplished using very simple JavaScript code.
Workflow
Regular expressions can be used to extract specific information from tokens used in your workflow. You can apply regular expressions to tokens with the Token Editor or Token Dialog, and the Pattern Matching activity.
Quick Fields
Regular expressions can be applied to document text and token values using the Pattern Matching and Substitution processes. When the text or token values match a pattern, Quick Fields can perform some action, such as identifying the document as belonging to a document class, automatically annotating the text that meets the pattern, or substituting different text. Pattern Matching expressions can also be used as constraints on particular fields to ensure data used in them meets specified criteria.
Documents
In Repository Administration, constraints for text fields can be created using regular expressions. Constraints for numeric fields (number, integer, and long integer) do not use regular expressions and instead use relational operators. For more information about relational operators, see Relational Operator Reference.
Helpful regular expressions to use when configuring field constraints in Repository Administration.
Connector
If you only want to use part of the value stored in a token, you can use regular expressions to extract just the information you need.
Capture Profiles
Regular expressions can be used to account for variations in a zone's anchor text and help locate the data you want to capture. When text matches the regular expression pattern, the capture profile can accurately find the correct information on the document.
Types of regular expressions
- Character Classes
- Quantifiers
- Character Escapes
- Grouping Constructs
- Metacharacters
- Alternations
- Options
More resources
- Laserfiche Workflow, Quick Fields, and Connector use .NET regular expressions. The Microsoft Developer Network (MSDN) website has additional information about this type of regular expression, including all supported language elements, best practices, and examples.
- Repository Administration uses ECMAScript regular expressions. The Microsoft Developer Network (MSDN) website lists all of the supported language elements.